<template>
  <div class="false-alarm-wrap">
    <div class="alarm-box">
      <span class="date">
        <i class="vul-icon-time"></i>
        <span>{{ item.updateTime }}</span>
      </span>
      <p class="line"></p>
      <span class="false-alarm-btn" @click="falseClick">
        <!-- <img src="@/static/images/retrieval/falseAlarm.png" alt="" /> -->
        <i class="vul-icon-prompt-line"></i>
        <span>标记为误报</span>
      </span>
      <p class="line"></p>
      <p class="follow">关注</p>
      <!-- <p class="follow">取消关注</p> -->
    </div>
  </div>
</template>

<script lang="ts" setup> 
import {defineProps,defineEmits, ref} from 'vue';
import {useStore} from 'vuex';
import { ElMessage, ElMessageBox } from 'element-plus';
const store=useStore();
const emit=defineEmits(['successFn'])
const props=defineProps({
  item: {
      type: Object,
      default: () => {
        return {};
      },
    },
})
const dialogVisible=ref(false);
const falseClick=()=> {
  ElMessageBox.confirm('确认此资产为误报吗？')
        .then(async () => {
          const { code, data = {} } = await store.dispatch(
            'expose/markAsset',
            {
              assetType: props.item.businessType,
              assetId: props.item.id,
              misinformation: 1,
            },
          );
          if (code !== 0) {
            return;
          }
          ElMessage.success('标记误报成功！');
          emit('successFn');
        })
        .catch((_) => {});
    }
</script>
<style lang="scss" scoped>
.false-alarm-wrap {
  margin-left: 10px;
  .alarm-box {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 160px;
    .date {
      display: flex;
      align-items: center;

      i {
        color: #8590b3;
        font-size: 14px;
        margin-right: 5px;
      }

      span {
        font-family: PingFangSC-Regular;
        font-size: 12px;
        line-height: 20px;
        // color: $-white;
      }
    }

    .line {
      height: 14.5px;
      border: 1px solid rgba(133, 144, 179, 0.3);
      margin: 0px 18px;
    }
    .follow {
      font-family: PingFangSC-Medium;
      font-size: 12px;
      line-height: 20px;
      color: $-v-color-primary;
      cursor: pointer;
    }
    .false-alarm-btn {
      display: flex;
      align-items: center;
      cursor: pointer;
      width: 82px;
      img {
        width: 14px;
        height: 14px;
      }

      i {
        font-size: 12px;
        color: #ff3333;
        margin-right: 2px;
      }

      span {
        font-family: PingFangSC-Medium;
        font-size: 12px;
        line-height: 20px;
        color: #ff3333;
      }
    }
  }
}
</style>
